<form action="" onSubmit="return false;" id="{$fprefix}dataform" class="ui-form" data-action="{$fprefix}">
    <input type="hidden" name="submit" value="1" />
    <input type="hidden" name="jx" value="1" />
    <input type="hidden" name="id" value="{$pv.data.id}" />
    <ul>
        <li class="ui-widget-header">
            {$lang.$admin_page.$base_request.pn}
        </li>
        {foreach $pv.settings.form_fields as $key=>$field}

        {if $field.type neq "hidden"}
        <li class="columns on-{$field.columns} {if $field.collapsed eq "1"}ui-helper-hidden-accessible{/if}">
            {if $field.type neq "wysiwyg" AND $field.type neq "special"}
            <div class="column first">
                {if $field.required eq 1} <span class="sprite-icons sprite-bullet_red"></span>
                {/if} <label class="{if $field.required eq "1"} required{/if}" for="{$fprefix}-{$key}"> {$lang.$base_request.$key} </label>
            </div>
            <div class="column second">
                {if $field.type eq "text"}
                <input type="text" name="{$key}" id="{$fprefix}-{$key}" value="{$pv.data.$key}" class="{$field.classes}"
                {foreach $field.data as $data_value} data-{$data_value@key}="{$data_value}"{/foreach} data-id="{$pv.data.id}" data-fprefix="{$fprefix}" />
                {if $field.special eq "check"} <span class="sprite-icons sprite-blankex" id="check-{$fprefix}-{$key}"></span>
                {/if}
                {/if}

                {if $field.type eq "date"}
                <input type="text" name="{$key}" id="{$fprefix}-{$key}" value="{$pv.data.$key|date_format:$config.date_format}" class="{$field.classes}" data-fprefix="{$fprefix}"/>
                {/if}

                {if $field.type eq "select"}
                <select name="{$key}" id="{$fprefix}-{$key}" class="{$field.classes}" data-fprefix="{$fprefix}" {foreach $field.data as $data_value} data-{$data_value@key}="{$data_value}"{/foreach}>
                    {if $field.special eq "states"}
                    {include file="_core/`$config.default_language`/states.tpl"}
                    {/if}
                    {if "templates/_admin/inc/`$base_request`_`$key`.tpl"|is_file}
                    {include file="_admin/inc/`$base_request`_`$key`.tpl"  key=$key field=$field}
                    {/if}
                </select>
                {/if}

                {if $field.type eq "checkbox"}
                <input type="checkbox" name="{$key}" id="{$fprefix}-{$key}" value="{$field.value}" class="{$field.classes}"
                {foreach $field.data as $data_value} data-{$data_value@key}="{$data_value}"{/foreach} data-id="{$pv.data.id}" data-fprefix="{$fprefix}"
                {if $fprefix eq "new"}
                {if $field.default eq $field.value}checked{/if}
                {/if}
                {if $fprefix eq "save"}
                {if $pv.data.$key eq $field.value}checked{/if}
                {/if} />
                &nbsp;{$field.text}
                {/if}

                {if $field.type eq "radio"}

		                {foreach $field.values as $value}
		                <div class="radio-item">
		                    <input type="{$field.type}" name="{$key}" {if $value@first}id="{$fprefix}-{$key}"{/if} value="{$value@key}" class="{$field.classes}"
		                    {foreach $field.data as $data_value} data-{$data_value@key}="{$data_value}"{/foreach} data-id="{$pv.data.id}" data-fprefix="{$fprefix}"
		                    {if $fprefix eq "new"}
		                    {if $field.default eq $value@key}checked{/if}
		                    {/if}
		                    {if $fprefix eq "save"}
		                    {if $pv.data.$key eq $value@key}checked{/if}
		                    {/if} />
		                    &nbsp;{$value}
		                </div>
		                {/foreach}

                {/if}
            </div>
            {/if}

            {if $field.type eq "wysiwyg"}
            <div class="heading">
                <label class="{$field.classes}" for="{$fprefix}-{$key}"> {$lang.$base_request.$key} </label>
            </div>
            <div class="">
                <textarea id="{$fprefix}-{$key}" name="{$key}" class="ui-helper-hidden" data-fprefix="{$fprefix}">{$pv.data.$key}</textarea>
                <div class="{$field.classes}" data-related="{$fprefix}-{$key}"></div>
            </div>
            {/if}

            {if $field.type eq "special"}
	            {if "templates/_admin/inc/`$base_request`_`$key`.tpl"|is_file}
	            	{include file="_admin/inc/`$base_request`_`$key`.tpl"}
	            {/if}
            {/if}

            {if $field.columns eq "3"}
            <div class="column third">
                Information
            </div>
            {/if}
        </li>
        {/if}

        {/foreach}
    </ul>
    <ul class="no-stripes">
        <li class="borderless">
            <label class="display-ib borderless"> </label>
            {if $fprefix eq "new"}
            <button class="ui-button ui-state-default ui-corner-all form-trigger" data-formid="{$fprefix}dataform">
                <span class="sprite-icons sprite-add icon-holder"></span>
                <span>{$pv.settings.buttons.new|default:$lang.forms.new}</span>
            </button>
            {/if}

            {if $fprefix eq "save"}
            <button class="ui-button ui-state-default ui-corner-all form-trigger" data-formid="{$fprefix}dataform">
                <span class="sprite-icons sprite-save_on icon-holder"></span>
                <span>{$pv.settings.buttons.save|default:$lang.forms.save}</span>
            </button>
            &nbsp;&nbsp;&nbsp;
            <button class="ui-button ui-state-default ui-corner-all cancel">
                <span class="sprite-icons sprite-cross icon-holder"></span>
                <span>{$pv.settings.buttons.cancel|default:$lang.forms.cancel_close}</span>
            </button>
            {/if}
        </li>
    </ul>
</form>
